﻿#region Header
/*
Behavioral Rating of Dancing Human Crowds based on Motion Patterns
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/
#endregion

#region Usings

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sebarf.Services.Interfaces;

#endregion

namespace paravili.Services {

	/// <summary>
	/// Description of the class
	/// </summary>
	public class ImageValidRegionProvider : Service, IImageValidRegionProvider {

		#region Public Properties

		[ServiceRequest]
		public IResetHandlerService ResetHandlerService {
			set { value.Reset += OnReset; }
		}

		[ServiceRequest]
		public ICurrentImageInformationLocatorService CurrentImageInformationLocatorService {
			set;
			get;
		}

		#endregion

		#region Private Methods

		private void OnReset(object sender, EventArgs e) {
			ResetInvalidRegionData();
		}

		#endregion

		#region IImageValidRegionProvider Members

		public bool[,] InvalidRegionByRowAndColumn {
			get;
			set;
		}

		public void ResetInvalidRegionData() {
			var imgSize = CurrentImageInformationLocatorService.GetImageSize();
			InvalidRegionByRowAndColumn = new bool[imgSize.Height, imgSize.Width];
		}

		#endregion
	}
}
